package com.example.problem2.bean;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "demoBean")
public class DemoBean {

    private String id;
    private String value;

    public static DemoBean createDemo() {
        DemoBean demoBean = new DemoBean();
        demoBean.setId("10001");
        demoBean.setValue("静态方法");
        return demoBean;
    }

    public DemoBean(String id, String value) {
        this.id = id;
        this.value = value;
    }

    public DemoBean() {
    }

    public String getId() {
        return id;
    }

    @XmlElement
    public void setId(String id) {
        this.id = id;
    }

    public String getValue() {
        return value;
    }

    @XmlElement
    public void setValue(String value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return "DemoBean{" +
                "id='" + id + '\'' +
                ", value='" + value + '\'' +
                '}';
    }
}
